<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
     <title>
      		  个人中心
	</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/font-awesome.min.css"  />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css"  />
</head>
<script src="${pageContext.request.contextPath}/js/jquery-1.6.3.js"></script>
 <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
 <script src="${pageContext.request.contextPath}/css/unslider.min.js"></script>
<script src="${pageContext.request.contextPath}/js/userCenterOrder.js"></script>
<body style="width:1366px">
	<div style="background: #F5F5F5;height:40px;padding-top: 8px" id="topdiv">
		<div style="margin-left:100px;">
			您好!<span style="color:#CD4F39">
			${user.name}
			</span>
		</div>
		<div style="margin-left:750px;">
			<a href="${pageContext.request.contextPath}">商城首页 <span class="fa fa-home" style="color:#FF7F00">
			</span>
			</a>
		</div>
		<div style="margin-left:50px;">
			<a href="${pageContext.request.contextPath}/user/center.action">个人中心 
			<span class="fa fa-cog"
				style="color:#FF7F00"></span>
			</a>
		</div>
		<div style="margin-left:50px;">
			<a href="${pageContext.request.contextPath}/user/outLogin.action">退出登录<span class="fa fa-user-circle-o"
				style="color:#FF7F00"></span>
			</a>
		</div>
	</div>
	<div id="toplogo" style="border-bottom:2px solid #FF3030;height:102px;">
		<div style="margin-left: 200px;float: left">
			<a href="${pageContext.request.contextPath}">
			<img src="${pageContext.request.contextPath}/img/juninglogo.jpg"
				width="100px" height="100px" />
			</a>
		</div>
		<div style="float: left;margin-left:500px; ">
			<img src="${pageContext.request.contextPath}/img/userCenter.png" >
		</div>
	</div>
	<div>
			<div class="mainLeft" style="float: left;">
				<ul style="list-style: none;">
					<li>
					<a  href="${pageContext.request.contextPath}/CartController/listCartByUser.action">我的购物车</a>
					</li>
					
					<li  >
					<a style="color:#FF6347;font-size: 16px;" href="${pageContext.request.contextPath}/OrderController/allOrderByUserId.action">
					我的订单
					</a>
					</li>
					<li>
					<a  href="${pageContext.request.contextPath}/AddressController/listAddress.action">
					我的地址</a>
					</li>
					<li>
					<a  href="${pageContext.request.contextPath}/user/center.action">
					账户设置</a>
					</li>
				</ul>
			</div>
			</div>
			<div  style="float: left;border:1px solid #DBDBDB;margin: 40px 0 0 100px;min-height: 500px;width: 950px">
					<div style="height:50px;width:100%;" id="navigation">
						<a href="${pageContext.request.contextPath}/OrderController/allOrderByUserId.action">
						<div class="navigationdiv" style="background: #fff;border: none" id='allordertitle'>
						<span style="font-size: 18px;">全部订单</span>
						</div>
						</a>
						<a href="${pageContext.request.contextPath}/OrderController/allOrderByUserId.action?state=1">
						<div  class="navigationdiv" id="alreadyordertitle">
						<span style="font-size: 18px">未收到货</span>
						</div>
						</a>
						<a href="${pageContext.request.contextPath}/OrderController/allOrderByUserId.action?state=2">
						<div class="navigationdiv" id="notordertitle">
						<span style="font-size: 18px">已收到货</span>
						</div>
						</a>	
					</div>
					<c:if test="${orders!=null}">
						<div id="allorder">
						<c:forEach items="${orders }" var="order">
						<div id="orderdiv${order.id}" style="height: 120px;width:880px;border:1px solid #DBDBDB;margin:20px 0 0 15px;position: relative;">
							<div style="float:left;margin:8px 0 0 10px;" >
								<a href="${pageContext.request.contextPath}/commodity/getComm.action?id=${order.commid}" target="_blank">
									<img src="${pageContext.request.contextPath}/file/img/${order.img}" style="height:100px;width:100px;border:1px solid #DBDBDB">
								</a>
								
							</div>
							<div style="float:left;height:100px;width:150px;margin:10px 0 0 10px">
								<!-- 防止存文本或字母溢出容器 -->
								<a href="${pageContext.request.contextPath}/commodity/getComm.action?id=${order.commid}" target="_blank">
								<span style="word-break:break-all;word-wrap:break-word;font-size: 15px">
									${order.commname }
								</span>
								</a>
							</div>
							<div style="float:left;margin:10px 0 0 30px;width:85px">
								<span>订单状态</span>
								<br><br>
									<c:choose>
										<c:when test="${order.state==0 }">
										<span>未确认订单</span>
										<br><br><a onclick="return cancel(this)">取消订单</a>
										<input type="hidden" value="${order.id}">
										</c:when>
										<c:when test="${order.state==1 }">
										<span>已确认订单</span>
										<br><br><a onclick="return cancel(this)">取消订单</a>
										<input type="hidden" value="${order.id}">
										</c:when>
										<c:when test="${order.state==2 }">
										<span>已安排发货</span>
										<br><br><a onclick="return lookd(this)">查看配送信息</a>
										<input type="hidden" value="${order.staffid}">
										</c:when>
										<c:when test="${order.state==3 }">
										<span>已完成</span>
										<br><br>
										<a onclick="return deletes(this)" >删除订单</a>
										<input type="hidden" value="${order.id}">
										</c:when>
										<c:when test="${order.state==4 }">
										<span>已取消订单</span>
										<br><br>
										<a onclick="return deletes(this)">删除订单</a>
										<input type="hidden" value="${order.id}">
										<span style="display:inline-block;
										position:absolute;top:91px;left:410px;">原因:${order.reason}</span>
										</c:when>
									</c:choose>
							</div>
							<div style="float:left;margin:10px 0 0 25px;">
							<span>所选分类</span>
							<br><br>
							<span >${order.classname }</span>
							</div>
							<div style="float:left;margin:10px 0 0 25px;width:70px">
							<span>价格</span>
							<br><br>
							<span style="color:#EE9572">¥${order.price }</span>
							</div>
							<div style="float:left;margin:10px 0 0 30px;">
								<span>购买数量</span>
								<br><br>
								<span style="color:#EE9572">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${order.num }
								</span>
							</div>
							<div style="float:left;margin:10px 0 0 20px;width: 70px">
								<span>订单号</span>
								<br><br>
								<span style="color:#EE9572;word-break:break-all;word-wrap:break-word;">
								${order.id }
								</span>
							</div>
							<div style="float:left;margin:25px 0 0 50px;">
								<a id="blankqq" href="tencent://message/?uin=3091482148&Site=&Menu=yes" style="margin-top:5px">
								联系我们</a>
								<div style="position:absolute;left:695px;top:90px;">
									<span style="font-weight:600">
									<fmt:formatDate value="${order.cdate}" pattern="yyyy年MM月dd日 HH:mm:ss"/>
									</span>
								</div>
							</div>
						</div>
						</c:forEach>
						</div>
					</c:if>
				<c:if test="${orders==null&&page==0&&state==0}">
					<h3 style="margin: 100px 0 0 300px">您还没有订单,快去
					<a href="${pageContext.request.contextPath}" style="color:#FF7F00">挑选吧!</a>
					</h3>
				</c:if>
				<c:if test="${orders==null&&page==0&&state!=0}">
					<h3 style="margin: 100px 0 0 400px;height:200px;color:red">没有查询到订单!
					</h3>
				</c:if>
				<c:if test="${orders==null&&page!=0}">
					<h3 style="margin: 100px 0 0 400px;height:200px;color:red">没有下一页了!
					</h3>
					<input type='hidden' value='0' id="nopage">
				</c:if>
				<div style="margin:20px 0 0 400px">
         	<a id="up" onclick="return page(this,1);" href="${pageContext.request.contextPath}/OrderController/allOrderByUserId.action?page=${page-1}" id="pagea" >上一页</a>
         	<span style="margin-left:30px ">当前第</span>
         	<span style="color:#FF6347" id="pageNum">${page+1}</span>页
         	<a id="bottom" onclick="return page(this,2);" href="${pageContext.request.contextPath}/OrderController/allOrderByUserId.action?page=${page+1}" style="margin-left:30px " id="pagea2">下一页</a>
         		</div>
				</div>
				<input type="hidden" value="${state }" id="statehidden">
				<input type="hidden" value="${pageContext.request.contextPath}/" id="path">
				<input type="hidden" value="${page }" id="pageNumh">
	</body>

	<style type="text/css">
	a{
	color:#191970;font-weight:600
	}
	a:hover{
	color:#4F4F4F;text-decoration:none;cursor: pointer; 
	}
	#orderbtn{
	background: #D9D9D9;height: 30px;width: 80px;border-radius:4px;
	border:2px solid #DBDBDB;
	}
	#blankqq{
	display: inline-block;background: #D9D9D9;height: 30px;width: 80px;border-radius:4px;
	border:2px solid #DBDBDB;text-align: center;padding-top:4px;
	}
	#blankqq:hover{
	background: #CFCFCF;
	}
	#orderbtn:hover{
	background: #CFCFCF;
	}
	.navigationdiv{
	height: 100%;width:150px;background: #DBDBDB;text-align: center;
	padding-top:10px;
	}
	.navigationdiv:HOVER{
	cursor: pointer;
	}
	#navigation div{
	float:left;
	}
	
	.mainLeft ul{
		margin:50px 0 0 70px;
		}
	.mainLeft li{
			margin:20px 0 0 0;width: 100px;height: 40px;text-align: center;
			}
	.mainLeft li a{
			color:#262626;
	}
	.mainLeft li a:hover{
			color:#FF6347;text-decoration:none;font-size: 16px;
	}
	.mainLeft li:hover{
			cursor: pointer;
			}
	#topdiv div{
	float:left;
	}
	</style>
	</html>